<template>
  <div>
    <!--    //月销量展表格-->
    <template>
      <el-table :data="sales" border style="width: 100%">
        <el-table-column fixed prop="typeName" label="类型名" width="150">
        </el-table-column>
        <el-table-column prop="siteGrossAll" label="销量" width="120">
        </el-table-column>
        <el-table-column prop="unit" label="单位" width="120">
        </el-table-column>
        <el-table-column prop="month" label="时间" width="120">
        </el-table-column>
        <el-table-column label="操作" width="200">
          <template slot-scope="scope">

             <el-button  @click="typeAllGrossMonth(scope.row.typeId,scope.row.siteGrossAll)" type="primary" style="margin-left: 16px;">
               查询个站点消失状况

             </el-button>

          </template>
        </el-table-column>
      </el-table>
    </template>



<el-drawer title="各站点销量" :visible.sync="drawer" :direction="rtl" :before-close="handleClose">

 <div v-for="a in typeMonth">


      <el-progress type="circle" :percentage="a.baifen"></el-progress>
      <p>{{a.siteName}}</p>
  </div>

</el-drawer>

  </div>
</template>

<script>
  export default {
    name: 'Comment',
    data() {
      return {

        drawer: false,//弹出框
typeSiteMonth:{},
siteGrossAll:"",
typeMonth:{},
        sales: [],//销量
      }
    },
    methods: {
      handleClose(done) {//弹出框
        this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {});
      },
      showAllGrossMonth() { //查看所有月销量

        this.$http.post("/platform/storageGrossMonth/showAllGrossMonth.admin", this.myGoods1)
          .then(resp => {
            this.sales = resp.data.data

            this.myGoods1 = ""
            if (resp.data.code != 200) {
              alert(resp.data.message)
            }
          })
      },

      typeAllGrossMonth(obj,obj1) { //查看所有月销量
this.typeSiteMonth.typeId=obj
this.typeSiteMonth.a=obj1
this.drawer = true

        this.$http.post("/platform/storageGrossMonth/typeAllGrossMonth.admin",this.typeSiteMonth)
          .then(resp => {
             this.typeMonth=resp.data.data

            this.myGoods1 = ""
            if (resp.data.code != 200) {
              alert(resp.data.message)
            }
          })
      },

    },
    created() {
      this.showAllGrossMonth()
    }
  }
</script>

<style>
</style>
